<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "state".
 *
 * @property int $state_code 省ID
 * @property string $name 中文名
 * @property string $name_hk 繁体中文名
 * @property string $name_en 英文名
 */
class State extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'state';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['state_code', 'name', 'name_hk', 'name_en'], 'required'],
            [['state_code'], 'integer'],
            [['name', 'name_hk'], 'string', 'max' => 25],
            [['name_en'], 'string', 'max' => 255],
            [['state_code'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'state_code' => 'State Code',
            'name' => 'Name',
            'name_hk' => 'Name Hk',
            'name_en' => 'Name En',
        ];
    }
}
